<?php
	
	/**
	 * 用户管理主界面
	 */
	class MainController extends AuthController{
		
		public function index(){
			//显示版权
			$this->assign('copy',C('COPY'));
			//显示标题
			$this->assign('title',C('WEBNAME'));
			//显示备案
			$this->assign('record',C('RECORD'));
			$this->display();
		}
		
		/**
		 * 欢迎界面  显示服务器信息
		 */
		 public function welcome(){
		 	
		 	$systemInfo =array();
			//系统环境
			$systeminfo['os'] = $_SERVER ['SERVER_SOFTWARE'];
			//php版本
			$systeminfo['version'] = PHP_VERSION;
			//服务器IP
			$systeminfo['serverip'] = $_SERVER['SERVER_ADDR'];
			//数据库信息
			$systeminfo['dbinfo'] = current(M('ask')->query("SELECT version() as v"))['v'];
			$admininfo = D('admin')->getAdmin(session('aid'));
			//登陆时间
			$systeminfo['logintime'] = date('Y-m-d H:i:s',$admininfo['logintime']);
			//最后一次登陆的IP
			$systeminfo['loginip'] = $admininfo['loginip'];
						
			//管理员登陆IP
			$this->assign('systeminfo',$systeminfo);
			
		 	$this->display();
		 }
		 /**
		  * 用户登出
		  */
		  public function out(){
		  	session_out();
			$this->success('退出成功~!',__APP__);
		  }
		  
		  
		  
		
	}
